package cn.edu.zut.score.core.convert;

import cn.edu.zut.score.core.dto.response.MessageResponse;
import cn.edu.zut.score.core.entity.Message;
import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zby
 * @date 2021/08/04
 */
@ApiModel("消息相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MessageConvert {

    MessageConvert INSTANCE = Mappers.getMapper(MessageConvert.class);

    MessageResponse message2Response(Message message);

    List<MessageResponse> messages2Responses(List<Message> messages);
}
